package com.fyt.controller.user.manager;

import com.fyt.controller.utils.Result;
import com.fyt.service.user.manager.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.util.Map;
@Validated
@RestController
public class UserController {

    @Autowired
    private UserService userService;
    @PostMapping("/api/user/manager/getList")
    Result getList(@RequestBody Map<String,String> map){ return userService.getList(map); }
    @PostMapping("/api/user/manager/addUser")
    Result addUser(@RequestBody Map<String,String>map){
        return userService.addUser(map);
    }
    @PutMapping("/api/user/manager/updateUser/{id}")
    Result updateUser(@PathVariable String id ,@RequestBody Map<String,String>map){
        map.put("id",id);
        return userService.updateUser(map);
    }
    @PutMapping("/api/user/manager/resetPassword/{id}")
    Result resetPassword(@PathVariable String id){
        return userService.resetPassword(id);
    }


}
